﻿
var newNode = null;

$(document).ready(function () {

});

$('input.btn-add').click(function (e) {

    // selected_flowcat_id
    if ($("select#ddlFlows").val() == null)
        return;

    var add_flow = {};
    add_flow.opt = "add_flow_to_flowcategory";
    add_flow.selected_flowcat_id = selected_flowcat_id;
    add_flow.selected_html_node_id = selected_html_node_id;
    add_flow.flow_id = $("select#ddlFlows").val();

    $.ajax({
        type: 'POST',
        url: '/Admin/Ajax/FlowCategoryService.aspx',
        data: JSON.stringify(add_flow),
        contentType: 'application/json; charset=utf-8',
        success: function (request, msg) {

            var obj = JSON.parse(request);

            console.log('add_flow_to_flowcategory success: ' + obj.Data);
            RefreshPage(obj.Data)
            // window.location = "/Admin/LCAFlow/ManageFlowCategories.aspx?selected_html_node_id=" + obj.Data;
            // Reload page with click on that node
        },
        error: function (request, status, error) {
            console.log('error');
        }

    });

});

$('input.btn-cancel').click(function (e) {

    $('.assign-flow').effect("fade", 300);
});
   